class MiscController < ApplicationController
  def index
    if request.subdomains.size > 1
      redirect_to 'http://byelr.com'
    elsif request.subdomains.size == 1 and request.subdomains[0] != 'www'
      sd = request.subdomains[0]
      if sd and not sd.empty? and sd != 'www'
        @_user = User.find_by_subdomain(sd)
        @current = 'blog'
        render :template => 'blog/index', :layout => 'blog'
      end
    elsif request.subdomains.size == 0 or (request.subdomains.size == 1 and request.subdomains[0] == 'www')
      @current = 'index'
      @latest_users = User.find(:all, :limit => 20, :order => "created_at desc")
    end
  end
end